import request from '@/utils/request'

export const editSchoolRule = (data, id) => {
  return request({
    url: `/school-rules/${id}`,
    method: 'put',
    data
  })
}
export const fetchSchoolAdmin = params => {
  return request({
    url: '/school-admins',
    params
  })
}
export const addSchoolAdmin = data => {
  return request({
    url: '/school-admins',
    method: 'post',
    data
  })
}
export const updateSchoolAdmin = (id, data) => {
  return request({
    url: `/school-admins/${id}`,
    method: 'put',
    data
  })
}
export const refreshSchoolAdminPassword = (id, data) => {
  return request({
    url: `/school-admins/refresh-password/${id}`,
    method: 'put',
    data
  })
}
export const modifySchoolAdminPassword = data => {
  return request({
    url: '/school-admins/modify-password',
    method: 'post',
    data
  })
}
export const fetchSchoolAdminLogs = params => {
  return request({
    url: '/school-admin-logs',
    params
  })
}
export const editSchool = (data, id) => {
  return request({
    url: `/schools/${id}`,
    method: 'put',
    data
  })
}
export const showSchool = params => {
  return request({
    url: '/schools',
    params
  })
}
export const showSchoolRule = params => {
  return request({
    url: '/school-rules',
    params
  })
}
